<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>\</title>
	<link rel="stylesheet" href="">
	<style type="text/css" media="screen">
		html,body{
			width: 100%;
			height: 100%;
		}
	</style>
</head>
<body>
<script type="text/javascript">
	var mybody = document.getElementsByTagName('body')[0];
	//滑动处理
	var h = document.documentElement.clientHeight;

        mybody.style.height = h + 'px';
    var startX, startY, moveEndX, moveEndY, X, Y;   

    mybody.addEventListener('touchstart', function(e) {

        e.preventDefault();

        startX = e.touches[0].pageX;

        startY = e.touches[0].pageY;

    });

    mybody.addEventListener('touchmove', function(e) {

        e.preventDefault();

        moveEndX = e.changedTouches[0].pageX;

        moveEndY = e.changedTouches[0].pageY;

        X = moveEndX - startX;

        Y = moveEndY - startY;

        if ( X > 0 ) {alert("‘向右’");}

        else if ( X < 0 ) {alert("‘向左’");}

        else if ( Y > 0) {alert("‘向下’");}

        else if ( Y < 0 ) { alert("‘向上’");}

        else{alert("‘没滑动’"); }

    });
</script>	
</body>
</html>